# Maintainer: Natanael Copa <ncopa@alpinelinux.org>
pkgname=iniparser
pkgver=4.2
pkgrel=0
pkgdesc="C library for parsing INI-style files"
url="https://github.com/ndevilla/iniparser"
arch="all"
license="MIT"
makedepends="bash"
subpackages="$pkgname-dev"
source="$pkgname-$pkgver.tar.gz::https://github.com/ndevilla/iniparser/archive/v$pkgver.tar.gz
	rpath.patch
	"

# secfixes:
#   4.1-r3:
#     - CVE-2023-33461

build() {
	make
}

check() {
	make check
}

package() {
	install -d "$pkgdir"/usr/lib "$pkgdir"/usr/include
	install -m 644 src/dictionary.h "$pkgdir"/usr/include/dictionary.h
	install -m 644 src/iniparser.h "$pkgdir"/usr/include/iniparser.h
	install -m 755 libiniparser.so.1 "$pkgdir"/usr/lib/libiniparser.so.1
	ln -s libiniparser.so.1 "$pkgdir"/usr/lib/libiniparser.so
}

sha512sums="
532479daad99a5966d559ff62164da40240df4401c7b6ae9a0adc4d3224c6434521d9be76aac06e671f4da48fe37b030fe0233fed5d1e86af2a8959055fcad79  iniparser-4.2.tar.gz
db7bdab6f8faafd47c8b50104e1a461fbd9324b75482b1455a8fc059c07278e7e60f088a3f712b0ade05a9bb989168d17684455b9863018f22a61e0190a888c6  rpath.patch
"
